<template>
  <div class="header">
    <span class="header-tit">{{ this.title }}</span>
    <div class="back-icon" @click="jump">
      <img src="../assets/img/my-indent/nav bar_icon_back 2@2x.png" alt="" />
    </div>
    <slot name="grabble-icon"></slot>
  </div>
</template>

<script>
export default {
  name: "indent-header",
  props: {
    msg: String,
    title: String,
  },
  data() {
    return {};
  },
  methods:{
    jump() {
      // if(this.$router)
      console.log(this.$route.path)
      if(this.$route.path == '/addressManage') {
        this.$router.push('/confirmOrder')
      }
      else if(this.$route.path == '/confirmOrder') {
        this.$router.push('/goodsDetail')
      }
      else if(this.$route.path == '/newaddress') {
        this.$router.push('/addressManage')
      }
    },
  }
};
</script>

<style lang="less" scoped>
.header {
  height: 0.44rem;
  background: white;
  width: 3.75rem;
  position: relative;
  text-align: center;
  .header-tit {
    display: block;
    font-size: 0.17rem;
    font-family: PingFang SC;
    font-weight: bold;
    color: #333333;
    padding-top: 0.1rem;
  }
  .back-icon {
    position: absolute;
    top: 0.12rem;
    left: 0.08rem;
    img {
      width: 0.16rem;
      height: 0.16rem;
      display: block;
    }
  }
}
</style>
